home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / cgazv3n4.zip / DIF-DIR.ZIP / DIFDATA.H < prev    next >
Text File  |  1989-04-23  |  2KB  |  62 lines

  1. /*************************** DIFDATA.H ****************************
  2. *   Data #defines for DIF side of dif.c
  3. *   (c) Copyright Victor Volkman, 1989. See dif.c for terms
  4. ******************************************************************/
  5.  
  6. #define DIF_STR_LEN  81      /* Max size of a DIF string field         */
  7. #define NUM_STRS     16      /* Number of labels & comments per vector */
  8. #define CR           0x0D    /* ASCII Carriage Return                  */
  9.  
  10. #define DIF_TYPE_SPECIAL (-1)
  11. #define DIF_TYPE_NUMERIC   0
  12. #define DIF_TYPE_STRING    1
  13.  
  14. enum dif_hdr_vals {
  15.    DIF_TABLE, DIF_VECTORS, DIF_TUPLES, DIF_DATA,
  16.    DIF_LABEL, DIF_COMMENT, DIF_SIZE, DIF_PERIODICITY, DIF_MAJORSTART,
  17.    DIF_MINORSTART, DIF_TRUELENGTH, DIF_UNITS, DIF_DISPLAYUNITS
  18.    };
  19.  
  20. #define NUM_HDR_VALS (((int) DIF_DISPLAYUNITS))
  21.  
  22. enum dif_val_vals {
  23.    DIF_VAL_V, DIF_VAL_NA, DIF_VAL_ERROR, DIF_VAL_TRUE,
  24.    DIF_VAL_FALSE, DIF_VAL_BOT, DIF_VAL_EOD
  25.    };
  26.  
  27. #define NUM_VAL_VALS (((int) DIF_VAL_EOD))
  28.  
  29. /* DIF cell in the input file appears as:
  30.    vector or type, float_val
  31.    str_val
  32. */
  33.  
  34. typedef struct {
  35.    int vector;          /* Vector if header cell, type indicator elsewhere */
  36.    double float_val;    /* numeric data in float format                    */
  37.    int dec_cnt;         /* number of digits following the decimal point    */
  38.    int numer_len;       /* number of digits, incl. dec. point and sign     */
  39.    char str_val[DIF_STR_LEN];  /* string value from cell, quotes removed   */
  40.    } dif_elt, *dif_elt_p;
  41.  
  42. typedef struct {
  43.    char **labels;              /* See text of the article for an   */
  44.    int num_labels;             /* explanation of these vector      */
  45.    char **comments;            /* topics.                          */
  46.    int num_comments;
  47.    int size;
  48.    int period;
  49.    int majorstart;
  50.    int minorstart;
  51.    int truelength;
  52.    char units[DIF_STR_LEN];
  53.    char displayunits[DIF_STR_LEN];
  54.    } vector_desc, *vector_desc_p;
  55.  
  56. typedef struct {
  57.    char title[DIF_STR_LEN];    /* Usually same as the filename     */
  58.    int num_vectors;            /* Same as fields in a database     */
  59.    int num_tuples;             /* Same as records in a database    */
  60.    vector_desc_p vec;          /* Describes each vector in a tuple */
  61.    } dif_hdr, *dif_hdr_p;
  62.